package com.example.repository;

import com.example.model.ThirdAppModel;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.data.model.query.builder.sql.Dialect;
import io.micronaut.data.r2dbc.annotation.R2dbcRepository;
import io.micronaut.data.repository.reactive.ReactiveStreamsCrudRepository;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@R2dbcRepository(dialect = Dialect.MYSQL) 
public interface AuthorRepository extends ReactiveStreamsCrudRepository<ThirdAppModel, Long> {
    @NonNull
    @Override
    Mono<ThirdAppModel> findById(@NonNull @NotNull Long aLong);

    @NonNull
    @Override
    Flux<ThirdAppModel> findAll();

    @Override
    <S extends ThirdAppModel> Publisher<S> save(@Valid @NotNull S entity);


}